package com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.entity.SysRole;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SysRoleMapper extends BaseMapper<SysRole> {
    @Select("SELECT sys_role.* From sys_role,sys_user,sys_user_role" +
            " where sys_user.id=sys_user_role.user_id" +
            " And sys_role.id=sys_user_role.role_id" +
            " And sys_user.id=#{userId}")
    List<SysRole> selectByUserId(Long userId);
}
